import request from '@/utils/request'

// 查询空闲时间(用于切片的)列表
export function listFree_time(query) {
  return request({
    url: '/doctor/free_time/list',
    method: 'get',
    params: query
  })
}
export function listByUserId(query) {
  return request({
    url: '/doctor/free_time/listByUserId',
    method: 'get',
    params: query
  })
}

// 查询空闲时间(用于切片的)详细
export function getFree_time(id) {
  return request({
    url: '/doctor/free_time/' + id,
    method: 'get'
  })
}

// 新增空闲时间(用于切片的)
export function addFree_time(data) {
  return request({
    url: '/doctor/free_time',
    method: 'post',
    data: data
  })
}

// 修改空闲时间(用于切片的)
export function updateFree_time(data) {
  return request({
    url: '/doctor/free_time',
    method: 'put',
    data: data
  })
}

// 删除空闲时间(用于切片的)
export function delFree_time(id) {
  return request({
    url: '/doctor/free_time/' + id,
    method: 'delete'
  })
}

export function validateAndRmFreeTime(ids, pwd) {
  const data = {
    pwd
  }
  return request({
    url: '/doctor/free_time/validateAndRmFreeTime/' + ids,
    method: 'delete',
    params: data
  })
}
